/*
 * RegexPatterns.java July 2009
 *
 * Copyright (C) 2009, Quirino Zagarese <quirino@laszloitalia.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 */
package org.eu4ria.enums;


/**
 * The Enum RegexPatterns.
 */
public enum RegexPatterns {

	/** Any character (may or may not match line terminators) */
	ANY(".*"),

	/** A digit: [0-9] */
	DIGITS("\\d"),

	/** A non-digit: [^0-9] */
	NON_DIGITS("\\D"),

	/** A whitespace character: [ \t\n\x0B\f\r] */
	WHITESPACES("\\s"),

	/** A non-whitespace character: [^\s] */
	NON_WHITESPACES("\\S"),

	/** A word character: [a-zA-Z_0-9] */
	WORD_CHARS("\\w"),

	/** A word character including spaces: [a-zA-Z_0-9] */
	WORD_CHARS_WITH_SPACES("\\w\\s"),

	/** A non-word character: [^\w] */
	NON_WORD_CHARS("\\W"),

	/** A lower-case alphabetic character: [a-z] */
	POSIX_LOWERCASE("\\p{Lower}"),

	/** An upper-case alphabetic character:[A-Z] */
	POSIX_UPPERCASE("\\p{Upper}"),

	/** A lower-case alphabetic character including spaces:[a-z]  */
	POSIX_LOWERCASE_WITH_SPACES("\\p{Lower}\\s"),

	/** An upper-case alphabetic character including spaces:[A-Z] */
	POSIX_UPPERCASE_WITH_SPACES("\\p{Upper}\\s"),

	/** All ASCII:[\x00-\x7F] */
	POSIX_ALL_ASCII("\\p{ASCII}"),

	/** An alphabetic character:[\p{Lower}\p{Upper}] */
	POSIX_ALPHABETIC("\\p{Alpha}"),

	/** An alphabetic character including spaces:[\p{Lower}\p{Upper}]*/
	POSIX_ALPHABETIC_WITH_SPACES("\\p{Alpha}\\s"),

	/** A decimal digit: [0-9] */
	POSIX_DIGITS("\\p{Digit}"),

	/** A decimal digit including spaces: [0-9] */
	POSIX_DIGITS_WITH_SPACES("\\p{Digit}\\s"),

	/** An alphanumeric character:[\p{Alpha}\p{Digit}] */
	POSIX_ALPHANUMERIC("\\p{Alnum}"),

	/** An alphanumeric character including spaces:[\p{Alpha}\p{Digit}] */
	POSIX_ALPHANUMERIC_WITH_SPACES("\\p{Alnum}\\s"),

	/** Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ */
	POSIX_PUNCTUATION("\\p{Punct}"),

	/** A visible character: [\p{Alnum}\p{Punct}] */
	POSIX_VISIBLE_CHARS("\\p{Graph}"),

	/** A visible character including spaces: [\p{Alnum}\p{Punct}] */
	POSIX_VISIBLE_CHARS_WITH_SPACES("\\p{Graph}\\s"),

	/** A printable character: [\p{Graph}\x20] */
	POSIX_PRINTABLE_CHARS("\\p{Print}"),

	/** A space or a tab: [ \t] */
	POSIX_SPACE_OR_TAB("\\p{Blank}"),

	/** A control character: [\x00-\x1F\x7F] */
	POSIX_CONTROL_CHARS("\\p{Cntrl}"),

	/** A hexadecimal digit: [0-9a-fA-F] */
	POSIX_HEX_DIGITS("\\p{XDigit}"),

	/** A whitespace character: [ \t\n\x0B\f\r] */
	POSIX_WHITESPACES("\\p{Space}"),

	/** Equivalent to java.lang.Character.isLowerCase() */
	JAVA_LOWERCASE("\\p{javaLowerCase}"),

	/** Equivalent to java.lang.Character.isUpperCase() */
	JAVA_UPPERCASE("\\p{javaUpperCase}"),

	/** Equivalent to java.lang.Character.isWhitespace() */
	JAVA_WHITESPACES("\\p{javaWhitespace}"),

	/** Equivalent to java.lang.Character.isMirrored() */
	JAVA_MIRRORED("\\p{javaMirrored}");




	/**
	 * Gets the pattern.
	 *
	 * @return the pattern
	 */
	public String getPattern(){
		return this.pattern;
	}

	/** The regular expression */
	private final String pattern;

	/**
	 * Constructor.
	 *
	 * @param pattern the regular expression
	 */
	RegexPatterns(String pattern) {
		this. pattern = pattern;

	}
}
